﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;


namespace ThuAnh
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            /*DataClasses1DataContext db= new DataClasses1DataContext();
            var query = from p in db.DEPARTMENTs
                        //where p.DEPARTMENTID = '1'
                        select new {p.DEPARTMENTID };
            dataGridView1.DataSource=query;
            DEPARTMENT department = db.DEPARTMENTs.Single(u => u.DEPARTMENTID == 2);
            //dataGridView1.DataSource = db.DEPARTMENTs;
            textBox1.Text = department.DEPARTMENTNAME;*/

            DataClasses1DataContext db = new DataClasses1DataContext();
            //CuonSach cuonsach = new CuonSach();
            var fjs = from p in db.sp_GetNews()
                      select p;                    
                      
            dataGridView1.DataSource = db.sp_GetNews();

        }
    }
}
